const batsDoor = world.querySelector('#5801的安全门');
if (batsDoor) {
  batsDoor.enableInteract = true;
  batsDoor.interactRadius = 4;
  batsDoor.interactHint = '安全门';
  batsDoor.onInteract(async ({ entity }) => {
    const safe = await entity.player.dialog({
      type: GameDialogType.INPUT,
      title: `安全门`,
      content: `请输入密码`,
    });
    if (safe) {
      if (safe === 'Bat5801') {
        entity.player.directMessage(`密码正确！`);
        batsDoor.collides = false;
        batsDoor.meshInvisible = true;
        batsDoor.enableInteract = false;
        await sleep(3000);
        batsDoor.collides = true;
        batsDoor.meshInvisible = false;
        batsDoor.enableInteract = true;
      } else {
        entity.player.directMessage(`密码有误！`);
      }
    }
  });
}
const table_bat = world.querySelector('#办公桌-坦率');
if (table_bat) {
  table_bat.enableInteract = true;
  table_bat.interactRadius = 6;
  table_bat.interactHint = `坦率的血翼蝠5801的电脑`;

  table_bat.onInteract(async ({ entity }) => {
    const computer_bat = await entity.player.dialog({
      type: GameDialogType.SELECT,
      title: `坦率的血翼蝠5801的电脑`,
      content: `请问需要使用什么功能`,
      options: ['Code', '坦率的血翼蝠5801的项目', '坦率的血翼蝠5801的联系方式'],
    });
    if (!computer_bat || computer_bat === null) {
      return;
    }
    switch (computer_bat.index) {
      case 0:
        //code
        break;
      case 1:
        entity.player.dialog({
          type: GameDialogType.SELECT,
          title: `坦率的血翼蝠5801的项目`,
          content: `当前坦率的血翼蝠5801正参与的项目`,
          options: [
            'Poppy Playtime-cuqal',
            '双人跑酷-辐射工作室',
            '不一样的米塔(烂尾)-坦率的血翼蝠5801',
            '恐怖奶奶4：灯塔(烂尾)-坦率的血翼蝠5801',
            '不一样的恐怖修女(烂尾)-坦率的血翼蝠5801',
            '羊了个羊(烂尾)-坦率的血翼蝠5801',
            '幽谷学校(似乎烂尾)-坦率的血翼蝠5801',
            '跳舞的线-坦率的血翼蝠5801',
          ],
        });
        break;
      case 2:
        entity.player.navigator.emitEvent('share', {
          title: '坦率的血翼蝠5801的联系方式',
          description: 'description',
          text: 'QQ 3958281494',
        });

        break;
    }
  });
}
